package com.easy.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.easy.bean.Orders;
import com.easy.order.service.impl.OrderServiceImpl;

@RestController
@RequestMapping("order/feign/")
@CrossOrigin
public class OrderFeignController {

    @Autowired
    OrderServiceImpl orderS;
    /**
     * 获取订单信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public Orders getOrderByID(@PathVariable int id) {
    	
    	return orderS.getOrderInfo(id);
    }
    /**
     * 修改订单状态
     * @param orderid
     * @param status
     * @return
     */
    @GetMapping("/orderstatus")
    public int changeOrderStatus(@RequestParam int orderid,@RequestParam int status) {
    	return orderS.changeOrderStatus(orderid, status);
    }
}
